import { filter } from 'lodash-es'
export const generateRoutes = (routeModuleList,jurisdiction) => {
  const routerFilter = (route) => {
    const {meta} = route
    const {key} = meta || {}
    if(!key) return true
    return JSON.parse(jurisdiction).some((item) =>key.includes(item) )
  }
    return filter([...routeModuleList],routerFilter)
}

